From: Ian Campbell Date: Wed, 8 Sep 2010 15:24:20 +0000 (+0100) Subject: xl: do not return to caller from monitoring daemon X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~11526 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=77a0acea701ed303efd11ef43c64345a7e32ce77;p=xen.git xl: do not return to caller from monitoring daemon The parent process will have returned to the caller and done whatever is necessary. The daemon should not return otherwise it will repeat this work. In the case of the migration receiver this causes it to try and take part in the migration protocol long after the sender+parent process have completed it, leading to confusing error messages (although strangely not much actual damange). Signed-off-by: Ian Campbell Signed-off-by: Ian Jackson --- diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 9393059e71..c2bfa0d311 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1645,6 +1645,14 @@ waitpid_out: if (child_console_pid > 0 && waitpid(child_console_pid, &status, 0) < 0 && errno == EINTR) goto waitpid_out; + + /* + * If we have daemonized then do not return to the caller -- this has + * already happened in the parent. + */ + if ( !need_daemon ) + exit(ret); + return ret; }